<include file="Public:header" title="类别管理 - 组别管理" />
<h2>类别管理</h2>
<span>当前共有 <{$count}> 个类别</span>
<form method="post" action="<{:U('addGroup?type=4')}>" onSubmit="return post_form('<{:U('addGroup?type=4')}>',this,'addTips');" style="height:40px;">
<div class="fl">
<label for="resSelector">资源类型</label>
<select name="res" id="resSelector" style="width:250px;" onchange="return changeRes(0,this,'#CategoriesTable');">
	<option value="0">请选择资源类型</option>
	<option value="0">教辅</option>
	<option value="1">视频</option>
	<option value="2">测验</option>
</select>   
<label for="addCategoryName">&nbsp;类别名</label><input id="addCategoryName" type="text" name="cname" placeholder="类别名" class="text" />
<input type="submit" value="添加类别" class="btn" /></div> <div id="addTips" class="tip fl" style="margin-top:2px;">添加提示</div>
</form>
<table style="width: 100%;">
  <thead>
    <tr>
	  <td style="min-width: 3%;text-align:center;">#</td>
	  <td style="text-align:center;">所属资源</td>
	  <td style="text-align:center;">类别名</td>
      <td style="text-align:center;">操作</td>
    </tr>
  </thead>
  <tbody id="CategoriesTable">
  <volist name="categories" id="vo" key="i">
    <tr>
      <td style="text-align:center;"><{$vo.id}></td>
	  <td style="text-align:center;">
	  <?php switch($vo['res']){
		case 0:
			echo '教辅';
			break;
		case 1:
			echo '视频';
			break;
		case 2:
			echo '测验';
			break;
		default:
			echo '未知';
	  } ?></td>
      <td style="text-align:center;"><{$vo.cname}></td>
	  <td style="text-align:center;"><a class="editCategory" href="<{:U('editCate?&id='.$vo['id'])}>">编辑</a>&nbsp;&nbsp;<a href="javascript:delGroup(4,<{$vo.id}>);">删除</a></td>
    </tr>
  </volist>
  </tbody>
</table>
<div class="pageSwitcher"><{$page}></div>
<include file="Public:footer" />